import frida
import sys

rdev = frida.get_remote_device()
session = rdev.attach("得物")


scr = """
Java.perform(function () {

    var addr_func = Module.findExportByName("libJNIEncrypt.so", "AES_128_ECB_PKCS5Padding_Encrypt");

    Interceptor.attach(addr_func, {

        onEnter: function(args){
            console.log("--------------------------执行函数--------------------------");
            console.log("参数1：",  args[0].readUtf8String()  );
            console.log("参数2：",  args[1].readUtf8String()  );
        },
        onLeave: function(retValue){
            console.log("返回值:", retValue.readUtf8String() );
        }

    })

});
"""
script = session.create_script(scr)

def on_message(message, data):
    print(message, data)


script.on("message", on_message)

script.load()
sys.stdin.read()
